import * as module from "@/tools/util";
import * as Request from '@/api/liubike';
import store from "@/tools/factory"
import { config, isDev } from '@/api/config';

import wx  from '@/tools/wx'
import commonJs from '@/views/commonJs/common'
let that
let loginInfo = null;

/**
 * 转化:   this.data -> this._data
 * ev.detail -> ev.target
 */

export default {
    mixins: [commonJs],
    data() {
        return {

        }
    },
    mounted() {
        that = this;
    },
    methods: {
        onShareAppMessage: function () {
            return {
                title: '小遛共享',
                path: '/index',
            }
        },
        onLoad: function (options) {
            that = this;
        },
        onShow() {
        },
        exit() {
            wx.showModal({
                title: "温馨提示",
                content: `你确定要退出当前账号吗？`,
                success(res) {
                    //移动登录信息,实名认证信息,注册路由,免押信息
                    module.removeStorages(['loginInfo', 'isAuth', 'regRoute', 'depositInfo', 'rideInfo', 'riding', 'reserve', 'appointment', 'orderno', "parkPay", 'gwsSalt', "unionOpenId"]);
                    // 跳转到
                   /* wx.navigateBack({
                        delta: 2 //返回的页面数，如果 delta 大于现有页面数，则返回到首页,
                    });*/
                    wx.redirectTo({
                        url: `/mobileLogin`
                    });

                }
            });
        },
        goAgreement() {
            wx.navigateTo({
                url: `/aboutAgreement?id=4`
            });
        },
        goWebView() {
            wx.navigateTo({
                url: `/webview?url=https://h5n.xlgxapp.com/apph5_v2/#/userAgreement`
            });
        },
        turnPage(e) {
            let query = e.currentTarget.dataset['target'];
            wx.navigateTo({
                url: `/${query}`
            });
        },
        tel: function () {
            wx.makePhoneCall({
                phoneNumber: '4006076666',
            })
        }
    }
}
